#ifndef __THREAD_POOL__
#define __THREAD_POOL__
#include <my_header.h>
#include "workerInfo.h"
#include "taskQueue.h"
#include "tcpInit.h"
#include "epollCtl.h"
#include "affair.h"
#include "dir_op.h"
#include "logInfo.h"
#include <mysql/mysql.h>


typedef struct threadPool_s{
    workerInfo_t workerInfo;
    taskQueue_t taskQueue;
    pthread_mutex_t mutex;
    pthread_cond_t cond;
    int exitFlag;
    int log_fd;
}threadPool_t;

struct server_config {
    char ip[16];
    int port;
    int workerNum;
};

void load_config(char *path, struct server_config *config);

int threadPoolInit(threadPool_t *pThreadPool, int workerNum, int log_fd);
int makeWorker(threadPool_t *pThreadPool);

#endif